<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php if(!$this->edit):?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	
	<thead>
		<tr>
			<th width="5">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
			</th>			
			<th width="">
				<?php echo JText::_( 'Название' ); ?>
			</th>
			<th width="100px">
				<?php echo JText::_( 'Порядок' ); ?>
			</th>
			<th width="200">
				<?php echo JText::_( 'Опубликовано' ); ?>
			</th>
			<th width="100">
				<?php echo JText::_( 'По умолчанию' ); ?>
			</th>

		</tr>
	</thead>
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->items ); $i < $n; $i++)	{
		$row = &$this->items[$i];
		$checked 	= JHTML::_('grid.id',   $i, $row->id );
		$link 		= JRoute::_( 'index.php?option=com_shop&view=payment&id='. $row->id );
		?>
		<tr class="<?php echo "row$k"; ?>">
			<td align="center">
				<?php echo $row->id; ?>
			</td>
			<td align="center">
				<?php echo $checked; ?>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->name; ?></a>
			</td>
			<td class="order">
				<span><?php echo $this->pagination->orderUpIcon($i); ?></span>
				<span><?php echo $this->pagination->orderDownIcon($i, $n); ?></span>
				<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>"  class="text_area" style="text-align:center" />		
			</td>
			<td align="center">
				<?php if($row->published == 1) echo '<span style="color:green;font-size:12px;font-weight:bold;">Да</span>'; else echo '<span style="color:red;font-size:12px;font-weight:bold;">Нет</span>'?>
			</td>
			<td align="center">
				<?php if($row->def == 1) echo '<span style="color:green;font-size:12px;font-weight:bold;">Да</span>'; else echo '<span style="color:red;font-size:12px;font-weight:bold;">Нет</span>'?>
			</td>
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
	</table>
</div>

<input type="hidden" name="option" value="com_shop" />
<input type="hidden" name="view" value="payment"/>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />

</form>
<? else:?>


<form action="" method="post" name="adminForm" id="adminForm" >
<div style="width:100%;float:left;">
<fieldset class="adminform">
    
    <table class="admintable" width="100%">
        <tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Название способа оплаты' ); ?>
                </label>
            </td>
			<td valign="top">
                <input class="text_area" type="text" name="name"  size="50" maxlength="100" value="<?php echo isset($this->item->name)?$this->item->name:'';?>" />
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Описание способа оплаты' ); ?>
                </label>
            </td>
			<td valign="top">
                <?php echo $this->editor->display('description', $this->item->description, "500" , "300", '30', '10');?>
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Опубликовано' ); ?>
                </label>
            </td>
			<td valign="top">
				<select name="published" size="1">
					<option value="1" <?php if(isset($this->item->published) && $this->item->published ==1) echo 'SELECTED';?> >Да</option>
					<option value="0" <?php if(isset($this->item->published) && $this->item->published ==0) echo 'SELECTED';?>>Нет</option>
				</select>
                
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'По умолчанию' ); ?>
                </label>
            </td>
			<td valign="top">
				<select name="default" size="1">
					<option value="1" <?php if(isset($this->item->def) && $this->item->def ==1) echo 'SELECTED';?> >Да</option>
					<option value="0" <?php if(isset($this->item->def) && $this->item->def ==0) echo 'SELECTED';?>>Нет</option>
				</select>
                
            </td>
        </tr>
    </table>
</fieldset>

</div>
<input type="hidden" name="option" value="com_shop" />
<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
<input type="hidden" name="task" value="" />


</form>

<?php endif;?>